<form>
  <div class="modal-head">
    {{#if change}}
      <h2>{{t 'coding_rules.change_details'}}</h2>
    {{else}}
      <h2>{{t 'coding_rules.activate_in_quality_profile'}}</h2>
    {{/if}}
  </div>

  <div class="modal-body modal-container">
    <div class="js-modal-messages"></div>

    {{#empty qualityProfiles}}
      {{#unless change}}
        <div class="alert alert-info">{{t 'coding_rules.active_in_all_profiles'}}</div>
      {{/unless}}
    {{/empty}}

    <div class="modal-field">
      <label>{{t 'coding_rules.quality_profile'}}</label>
      {{#any key qProfile}}
        {{name}}
      {{else}}
        <select id="coding-rules-quality-profile-activation-select">
          {{#each qualityProfiles}}
            <option value="{{key}}" {{#eq key ../contextProfile}}selected{{/eq}}>
              {{#repeat depth}}&nbsp;&nbsp;&nbsp;{{/repeat}}{{name}}
            </option>
          {{/each}}
        </select>
      {{/any}}
    </div>
    <div class="modal-field">
      <label>{{t 'severity'}}</label>
      <select id="coding-rules-quality-profile-activation-severity">
        {{#each severities}}
          <option value="{{this}}">{{t 'severity' this}}</option>
        {{/each}}
      </select>
    </div>
    {{#if isCustomRule}}
      <div class="modal-field">
        <p class="note">{{t 'coding_rules.custom_rule.activation_notice'}}</p>
      </div>
    {{else}}
      {{#each params}}
        <div class="modal-field">
          <label>{{key}}</label>
          {{#eq type 'TEXT'}}
            <textarea class="width100" rows="3" name="{{key}}" placeholder="{{defaultValue}}">{{value}}</textarea>
          {{else}}
            {{#eq type 'BOOLEAN'}}
              <select name="{{key}}" value="{{value}}">
                <option value="{{defaultValue}}">{{t 'default'}} ({{t defaultValue}})</option>
                <option value="true"{{#eq value 'true'}} selected="selected"{{/eq}}>{{t 'true'}}</option>
                <option value="false"{{#eq value 'false'}} selected="selected"{{/eq}}>{{t 'false'}}</option>
              </select>
            {{else}}
              <input type="text" name="{{key}}" value="{{value}}" placeholder="{{defaultValue}}">
            {{/eq}}
          {{/eq}}
          <div class="modal-field-description">{{{htmlDesc}}}</div>
          {{#if extra}}
            <div class="modal-field-description">{{extra}}</div>
          {{/if}}
        </div>
      {{/each}}
    {{/if}}
  </div>

  <div class="modal-foot">
    <button id="coding-rules-quality-profile-activation-activate"
            {{#unless saveEnabled}}disabled="disabled"{{/unless}}>
      {{#if change}}{{t 'save'}}{{else}}{{t 'coding_rules.activate'}}{{/if}}
    </button>
    <a id="coding-rules-quality-profile-activation-cancel" class="js-modal-close">{{t 'cancel'}}</a>
  </div>
</form>
